//
//  UrlManager.m
//  Four_Fit_New
//
//  Created by lanou on 16/7/14.
//  Copyright © 2016年 xmaz. All rights reserved.
//

#import "UrlManager.h"
#import "FindModel.h"
static UrlManager *manger = nil;
@implementation UrlManager

+ (instancetype)creatUrlManager{
    if (manger == nil) {
        manger = [[UrlManager alloc]init];
    }
    return manger;
}
///组装网址
- (NSString *)packageURLWithNsArray:(NSArray *)arr andUrl:(NSString *)url{
    NSMutableString *urlResult = [NSMutableString string];
    [urlResult setString:url];
    for (int i=0;i<arr.count;i++) {
        FindModel *model = arr[i];
        [urlResult appendFormat:@"id=%@&",model.infoId];
    }
    
    NSRange range = {urlResult.length-1,1};
    
    [urlResult deleteCharactersInRange:range];
    NSLog(@"%@",urlResult);
    return urlResult;
}

///饮食数据请求
- (void)fetchEatingDataWithUrl:(NSString *)url{
    
    
    [[QZRequestManager sharedManager] fetchDataWithUrl:url parameters:@{} method:@"GET" needToCaches:NO fetchData:^(NSData *data) {
       
        NSDictionary *scrDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
        
    } updateUI:^{
        
    }];
    
    
}

///




@end
